#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1e6 + 5;
const int M = 2005;
int n, m;
int a[N];
int b[M], cnt;

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  rep(i, 1, n) cin >> a[i];
  int len = n, mn = 1, mx = n;
  int l = 0, r = 0;
  while (true) {
    if (--b[a[l++]] == 0) cnt--;
    // adjust right bound
    while (r < n && cnt < m)
      if (++b[a[++r]] == 1) cnt++;
    if (cnt < m) break;
    // adjust left bound
    while (b[a[l]] != 1) --b[a[l++]];
    int now = r + 1 - l;
    if (now < len) len = now, mn = l, mx = r;
  }
  cout << mn << ' ' << mx;
  return 0;
}